package com.xiaofan.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 *
 * 处理异常的类
 * @version 1.0
 * @author 晓帆
 **/
@ControllerAdvice
public class CustomException {
    /**
     * 返回用户名异常页面
     * @return String 对应的静态资源地址
     */
    @ExceptionHandler(UsernameException.class)
    public String usernameException(){
        return "usernameException";
    }

    /**
     * 返回密码异常的页面
     * @return String  对应的静态资源地址
     */
    @ExceptionHandler(PasswordException.class)
    public String passwordException(){
        return "passwordException";
    }

}
